<template>
	<view>
		<view class="qrcode">
			<canvas style="width: 400upx;height: 400upx;" canvas-id="couponQrcode"></canvas>
		</view>
		<view class="title">
			南航碧桂园小区101栋2单元401
		</view><br>
		<view class="title">
			分享此二维码至访客手机，访客扫码即可开门
		</view><br>
		<u-button type="primary" text="发送给朋友" style="width: 380px;"></u-button><br>
		<u-button type="primary" text="继续邀请" style="width: 380px;"></u-button>
	</view>
</template>

<script>
	const qrCode = require('@/utils/weapp-qrcode.js')
	export default {
		data() {
			return {

			}
		},
		onLoad(e) {
			// this.Obj = JSON.parse(decodeURIComponent(e.data));
			// alert(this.Obj)
			// let form = JSON.parse(decodeURIComponent(options));

			setTimeout(() => {
				this.couponQrCode()
			}, 50)
		},
		methods: {
			// 二维码生成工具
			couponQrCode() {
				new qrCode('couponQrcode', {
					text: "高文斌傻逼",
					width: 200,
					height: 200,
					colorDark: "#333333",
					colorLight: "#FFFFFF",
					correctLevel: qrCode.CorrectLevel.H
				})
			}
		}
	}
</script>

<style>
	.qrcode {
		padding: 50upx 0 20upx 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.title {
		text-align: center;
	}
</style>
